package com.ethink.order.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.TobSaleOrderInfo;
import com.ethink.order.api.model.TobSaleAndSettleModel;
import com.ethink.order.api.model.TobSaleOrderAndReturnModel;
import com.ethink.order.api.model.TobSaleOrderGoodsModeModel;
import com.ethink.order.api.model.TobSaleOrderModel;
import com.ethink.order.api.request.*;
import com.ethink.order.api.response.TobSaleOrderAddResponse;

import java.util.ArrayList;
import java.util.List;

/**
 * TOB销售单 Service接口
 *
 * @author default
 * @date 2022-11-16
 */
public interface TobSaleOrderService {
    TobSaleOrderAddResponse addTobSaleOrder(TobSaleOrderAddRequest request);

    Page<TobSaleOrderModel> pageQueryTobSaleOrder(TobSaleOrderPageQueryRequest request);

    void deleteTobSaleOrder(Long id);

    TobSaleOrderInfo queryTobSaleOrderById(Long id);

    Page<TobSaleAndSettleModel> tobSaleAndSettlePageQuery(TobSaleAndSettlePageQueryRequest request);

    void updateTobSaleOrderStatus(TobSaleOrderSetStatusRequest request);

    Boolean checkSettleImport(TobSettleImportCheckRequest checkRequest);

    Integer TobSaleOrderPoInsert(TobSaleOrderPoInsertRequest request);

    Boolean settleStatus(List<String> orderNo);

    TobSaleOrderInfo getTobSaleOrderInfoByOrderNo(String orderNo);

    List<String> queryDetailOrderNoByOrderNo(List<String> orderNo);

    /**
     * 查询待结算明细和待退数量
     *
     * @param mateSkuList
     * @param saleSubChannel 订单来源
     * @return
     */
    List<TobSaleOrderAndReturnModel> queryToBeSettleDetail(List<String> mateSkuList, String saleSubChannel, List<String> poList);

    /**
     * 分页查询
     *
     * @param request
     * @return
     */
    Page<TobSaleOrderGoodsModeModel> pageQueryTobSaleOrderPageMode(TobSaleOrderPageGoodsModeQueryRequest request);


    void batchSettleOrder(List<String> orderNos);

    List<TobSaleOrderAndReturnModel> queryToBeSettleDetailByPo(List<String> mateSkuList, String saleSubChannel, List<String> poAndSkuList);
}